package es.battleship.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import com.google.appengine.api.datastore.Key;


@XmlRootElement
@PersistenceCapable
public class Game {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;
	
	@Persistent(defaultFetchGroup = "true")	
	private GameStatus status;
	
	@Persistent(defaultFetchGroup = "true") 
	private GameConfig gameConfig;

	
	public Game() {
	}

	@XmlTransient
	public Key getId() {
		return id;
	}

	public void setId(Key id) {
		this.id = id;
	}

	public GameStatus getStatus() {
		return status;
	}

	public void setStatus(GameStatus status) {
		this.status = status;
	}

	public GameConfig getGameConfig() {
		return gameConfig;
	}

	public void setGameConfig(GameConfig gameConfig) {
		this.gameConfig = gameConfig;
	}

	public String toString() {
		return "Game { Id: " + 
					id 
					+ " } ";
	}
}
